<template>
  <el-config-provider :locale="zhCn">
    <el-pagination
      background
      layout="prev, pager, next, jumper"
      v-bind="$attrs"
      @current-change="handleCurrentPageChange"
    ></el-pagination>
  </el-config-provider>
</template>

<script>
import { ElPagination, ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
export default {
  name: 'Pagination',
  components: {
    ElPagination,
    ElConfigProvider
  },
  emits: ['currentChange'],
  setup(props, { emit }) {
    const handleCurrentPageChange = (value) => {
      emit('currentChange', value)
    }
    return {
      zhCn,
      handleCurrentPageChange
    }
  }
}
</script>
